<!-- 关注和粉丝 -->
<template>
	<view>
		<view class="pageBox">
			<view class="navBox">
				<view class="item" :class="{active:navIndex==0}" @click="navFn(0)">
					<view class="txt">关注</view>
					<view class="line"></view>
				</view>
				<view class="item" :class="{active:navIndex==1}" @click="navFn(1)">
					<view class="txt">粉丝</view>
					<view class="line"></view>
				</view>
			</view>
			<view class="contentBox">
				<scroll-view scroll-y="true" class="scrollStyle">
					<view>
						<view class="item">
							<view class="left">
								<image src="" mode="" class="img"></image>
								<view class="txtBox">
									<view class="txt1">谭晖</view>
									<view class="txt2">开始关注了你</view>
								</view>
							</view>
							<view class="right" @click="guanzhuFn">已关注</view>
						</view>
					</view>
				</scroll-view>
			</view>
		</view>
		<!-- 弹窗 -->

	</view>
</template>

<script>
	export default {
		data() {
			return {
				navIndex: 0, //当前选择的导航
			}
		},
		methods: {
			// 切换菜单
			navFn(index) {
				this.navIndex = index;
			},
			// 关注和取消关注
			guanzhuFn() {
				uni.showModal({
					title: '提示',
					content: '确认不再关注？',
					success(res) {
						if (res.confirm) {
							console.log('用户点击确定');
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},

		}
	}
</script>

<style lang="scss" scoped>
	.pageBox {
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		display: grid;
		grid-template-rows: auto 1fr;

		.navBox {
			height: 72rpx;
			border-bottom: 1px solid #E9E9E9;
			display: flex;
			justify-content: center;
			align-items: center;

			.item {
				margin: 0 40rpx;
				display: flex;
				flex-direction: column;
				align-items: center;

				.txt {
					color: $gray-six;
					font-size: $font-saner;
					font-weight: bold;
				}

				.line {
					margin-top: 4rpx;
					width: 54rpx;
					height: 4rpx;
					border-radius: 2rpx;
				}
			}

			.active {
				.txt {
					color: $gray-three;
				}

				.line {
					background-color: $pink;
				}
			}
		}

		.contentBox {
			position: relative;

			.scrollStyle {
				position: absolute;
				left: 0;
				top: 0;
				right: 0;
				bottom: 0;

				.item {
					width: 714rpx;
					height: 176rpx;
					border-bottom: 1px solid #E9E9E9;
					margin: 0 auto;
					display: flex;
					justify-content: space-between;
					align-items: center;

					.left {
						display: flex;
						align-items: center;

						.img {
							display: block;
							width: 80rpx;
							height: 80rpx;
							background-color: red;
							border-radius: 50%;
						}

						.txtBox {
							margin-left: 20rpx;

							.txt1 {
								color: $gray-three;
								font-size: $font-erba;
								font-weight: bold;
							}

							.txt2 {
								margin-top: 6rpx;
								color: $gray-six;
								font-size: $font-ersi;
							}
						}
					}

					.right {
						width: 130rpx;
						height: 50rpx;
						border: 1px solid $gray-nine;
						border-radius: 25rpx;
						color: $gray-three;
						font-size: $font-erliu;
						font-weight: bold;
						text-align: center;
						line-height: 48rpx;
					}
				}
			}
		}
	}
</style>